package gameDisplayer;

import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Image;

import java.util.List;
import javax.swing.JComponent;
import javax.swing.JFrame;
import gameManager.AmmunitionObject;
import gameManager.Interactable;
import gameManager.GameManager;




public class Game extends JComponent{
private List<Interactable> myInteractableCharacters;
private Image myBackGroundImage;

public Game( List<Interactable> InteractableCharacters){
    myInteractableCharacters = InteractableCharacters;
    
}
    public void paintComponent (Graphics2D pen,Dimension dim) {
        drawBackground(pen, myBackGroundImage);
        for(Interactable i:myInteractableCharacters){
       pen.drawImage(i.getObjectImage(),i.getCenter().x,i.getCenter().y,null);
        }

        
    }
    public void setmyBackGroundImage(Image image){
        myBackGroundImage=image;
    }
    public void drawBackground(Graphics2D pen,Image myImage){
        
        
        pen.drawImage(myImage,0,0,null);
        
    }

}
